import request from '@/utils/request';
import { getPageSize } from '@/utils/common';

// 一、柜型标准油耗
// 1、查询柜型标准油耗列表
export async function selectCabinetOilList(params) {
  params.pageSize = params.pageSize || getPageSize();
  return request(`/server/api/tms/tms-standard-oil-wear/selectTmsStandardOilWearList`, {
    method: 'POST',
    body: params,
  });
}

// 2、查询柜型标准油耗详情
export async function selectCabinetOilDetail(params) {
  return request(`/server/api/tms/tms-standard-oil-wear/viewTmsStandardOilWearDetails`, {
    method: 'POST',
    body: params,
  });
}

//3、新增、编辑--柜型标准油耗
export async function cabinetOilOperate(params) {
  let url = '';
  if (params.id) {
    url = 'updateTmsStandardOilWear';
  } else {
    url = 'insertTmsStandardOilWear';
  }
  return request(`/server/api/tms/tms-standard-oil-wear/${url}`, {
    method: 'POST',
    body: params,
  });
}

// 4、柜型标准油耗 删除
export async function removeCabinetOil(params) {
  return request(`/server/api/tms/tms-standard-oil-wear/deleteTmsStandardOilWear`, {
    method: 'POST',
    body: params,
  });
}

/**
 * 查询附件
 */
export async function selectFileList(params) {
  return request(`/server/api/tms/attachment/selectFileList`, {
    method: 'POST',
    body: params,
  });
}
